<style>
</style>
<template>
  <div class="app-container">
    <table>
      <tr>
        <h2>停车信息</h2>
      </tr>
      <td>
        <tr style="width: 600px;">流水号: {{this.form.crid}}</tr>
        <tr>车牌颜色: {{this.form.carsPlateColors.carsPlateName}}</tr>
        <tr>入场时间: {{this.form.intoTime}}</tr>
        <tr>车辆类型: {{this.form.carsType.typeName}}</tr>
      </td>
      <td>
        <tr>车牌号: {{this.form.carsMsg.licenseNumber}}</tr>
        <tr>停车时长/分: {{minus}}</tr>
        <tr>出场时间: {{this.form.outsideTime}}</tr>
      </td>
      <tr><h1>车场信息</h1></tr>
      <tr>
        <td style="width: 600px;">物业名称: {{ this.form.propertyManagement.propertyName }}</td>
        <td>停车场名称: {{ this.form.carsHome.chname }}</td>
        <td></td>
      </tr>
      <tr><h1>进出场基本信息</h1></tr>
      <td>
        <tr>入场车道: {{this.form.carsHomeEqChukou.carsHomeLane.lanename}}</tr>
        <tr>入场设备: {{this.form.carsHomeEq.eqname}}</tr>
        <tr>入场设备IP: {{this.form.carsHomeEq.eqip}}</tr>
      </td>
      <td>
        <tr>出场车道: {{this.form.carsHomeEqChukou.carsHomeLane.lanename}}</tr>
        <tr>出场设备: {{this.form.carsHomeEqChukou.ckname}}</tr>
        <tr>出场设备IP: {{this.form.carsHomeEqChukou.ckip}}</tr>
      </td>
      <tr><h1>停车照片</h1></tr>
      <tr>
        <td style="line-height: 50px">入位照片:</td>
        <td>离位照片:</td>
      </tr>
      <tr>
        <el-button
          @click="up"
        >返回</el-button>
      </tr>
    </table>

  </div>

</template>

<script>

export default {
  name: "Cars",
  data() {
    return {
      form: [],
      minus: ''
    };
  },
  mounted() {

  },
  created() {
    this.form = this.$route.query.form
    this.feng();
  },
  methods: {
    feng() {
      if (this.form.outsideTime != null && this.form.intoTime) {
        const s2 = this.form.outsideTime
        const s1 = this.form.intoTime
        const t1 = Date.parse(s1.replace(/-/g, '/'))
        const t2 = Date.parse(s2.replace(/-/g, '/'))
        const minu = (t2 - t1) / 1000 / 60
        const minus = Math.floor(minu);
        console.log(minus)
        return this.minus = minus
      } else {
        return ""
      }
    },
    up(){
      this.$store.dispatch('tagsView/delAllViews',this.$router);
      this.$router.push('cars')
    }
  },
};
</script>
